
class cassandra::senbase {

  include cassandra
#var needed by templates
  $java_path = $cassandra::java_path
  $ops_path = $cassandra::ops_path
  $cassandra_path = $cassandra::cassandra_path
  $cassandra_base = "${cassandra::home_path}/workdata"
  $conf_path = $cassandra::conf_path
  $run_path = $cassandra::run_path

  $cluster_name = 'SEN CLUSTER'
  $ops_center = '111.206.210.142'
  $local_disk = '/letv/sen_cassandra'
  $key_node = '106.39.244.103,118.26.57.22,60.12.79.138'

  File{
    owner => 'cassandra',
    group => 'root',
  }

  file{["$cassandra_base", "$local_disk"]:
	ensure => directory,
	mode => 0770,
  }
  -> file{
	'data_path':
	path => "${local_disk}/data",
	mode => 0770,
	ensure => directory;

	'cmlog_path':
        path => "${local_disk}/commitlog",
        mode => 0770,
        ensure => directory;

	'cache_path':
        path => "${local_disk}/caches",
        mode => 0770,
        ensure => directory;
  }
  -> file{
	'data_link':
        path => "${cassandra_base}/data",
        ensure => link,
        target => "${local_disk}/data";

	'cmlog_link':
	path => "${cassandra_base}/commitlog",
	ensure => link,
	target => "${local_disk}/commitlog";

        'cache_link':
        path => "${cassandra_base}/saved_caches",
        ensure => link,
        target => "${local_disk}/caches";
  }

}

